using System;

using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml;

namespace GDIdotNETgames
{
    public class ClassMapImage
    {
        private string _filename = string.Empty;
        private Bitmap _image = null;

        public Bitmap Image
        {
            get { return _image; }
        }

        public ClassMapImage(XmlReader reader, Size size)
        {
            _filename = reader.GetAttribute("Filename");
            _image = new Bitmap(new Bitmap(AppDomain.CurrentDomain.BaseDirectory + _filename), size);
        }

        public void SerializeToXML(XmlWriter writer)
        {
            writer.WriteStartElement("Image");
            writer.WriteAttributeString("Filename", _filename);
            writer.WriteEndElement();
        }
    }
}
